﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>ResetPwd</title>
    <script src="../../Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            //首次加载
            $("#checkCode").attr("src", "/Common/GetCheckCode?time=" + (new Date()).getTime());
            $.get("/Common/GetCurrentCheckCode", function (data) {
                $("#checkCode").val(data);
            });
            //单击验证码事件
            $("#checkCode").bind("click", function () {
                this.src = "/Common/GetCheckCode?time=" + (new Date()).getTime();
                $.get("/Common/GetCurrentCheckCode", function (data) {
                    $("#checkCode").val(data);
                });
            });
        });

        function SubmitPage() {
            $.ajax({
                type: "POST",
                url: "/Account/ResetPwd",
                data: { account: function () { return $("#account").val() } },
                success: function (msg) {
                    if (msg == "success") {
                        window.location = "/Account/Login";
                        alert("重置密码请求提交成功！请主动联系管理员！");
                    }
                    else {
                        alert(msg);
                    }
                }
            });
        }
    </script>
</head>
<body>
    @Html.ActionLink("返回登录","Login")
    <div>
        <table>
            <tr>
                <td>请输入账号：</td>
                <td><input id="account" name="account" type="text" /></td>
            </tr>
            <tr>
                <td>请输入验证码：</td>
                <td colspan="2"><div><input style=" width:80px; float:left" id="txtCheckCode" class="txtCheckCode" maxlength="4" type="text" /></div><div style="float:right"><img id="checkCode" class="checkCode" src="/Common/GetCheckCode" alt="" /></div></td>
            </tr>
        </table>
        <input type="button" value="提交" onclick="SubmitPage()" />
    </div>
</body>
</html>
